﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class AccountTransfer
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID 
        { 
            get{return _id;}
            set { _id = value; }
        }

        private DateTime _transferDate;
        [DataMember]
        public DateTime TransferDate 
        { 
            get{ return _transferDate;}
            set { _transferDate = value; }
        }

        private DateTime _receiveDate;
        [DataMember]
        public DateTime ReceiveDate
        {
            get { return _receiveDate; }
            set { _receiveDate = value; }
        }

        private BankAccount _source;
        [DataMember]
        public BankAccount Source
        {
            get { return _source; }
            set { _source = value; }
        }

        private BankAccount _target;
        [DataMember]
        public BankAccount Target
        {
            get { return _target; }
            set { _target = value; }
        }

        private decimal _amount;
        [DataMember]
        public decimal Amount
        {
            get { return _amount; }
            set { _amount = value; }
        }

        private decimal _serviceCharge;
        [DataMember]
        public decimal ServiceCharge
        {
            get { return _serviceCharge; }
            set { _serviceCharge = value; }
        }

        private decimal _excehangeRate;
        [DataMember]
        public decimal ExcehangeRate
        {
            get { return _excehangeRate; }
            set { _excehangeRate = value; }
        }

        public override bool Equals(object obj)
        {
            AccountTransfer temp = obj as AccountTransfer;
            if (temp == null)
                return false;
            return(this.ID.Equals(temp.ID));
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }
}
